const path = require('path');

/**
 * __dirname is changed after webpack-ed to another directory
 * so process.cwd() is used instead to determine the correct base directory
 * Read more: https://nodejs.org/api/process.html#process_process_cwd
 */
const ROOT_PATH = process.cwd(); // 当前项目目录
const APP_PATH = path.resolve(ROOT_PATH, 'app'); // 应用根目录
const PAGES_PATH = path.resolve(APP_PATH, 'pages'); // 多个入口页面目录
const ASSETS_PATH = path.resolve(ROOT_PATH, 'assets'); // 公共静态资源目录
const BUILD_PATH = path.resolve(ROOT_PATH, 'build'); // 项目编译的目录
const MODULES_PATH = path.resolve(ROOT_PATH, 'node_modules'); // NPM默认的模块目录

module.exports = {
    ROOT_PATH,
    APP_PATH,
    PAGES_PATH,
    ASSETS_PATH,
    BUILD_PATH,
    MODULES_PATH,
};
